<template>
  <h1>EL-单选组件</h1>
  <el-radio-group v-model="ssl">
    <el-radio label="学历：高中" value="高中"></el-radio>
    <el-radio label="学历：专科" value="专科"></el-radio>
    <el-radio label="学历：本科" value="本科"></el-radio>
    <el-radio label="学历：硕士" value="硕士"></el-radio>
  </el-radio-group>
  <h4>你选择的结果是:{{ssl}}</h4>
  <br>
  <el-radio-group v-model="price" >
    <el-radio v-for="item in arr" :label="item.label" :value="item.value"></el-radio>
  </el-radio-group>
  <h4>您选择的酒价是:{{price}}</h4>

</template>
<script setup>
import {ref} from "vue";
//定义变量来保存选择的数值
const ssl = ref('罗婉宁')
//模拟数据库查出来的值
const arr=ref(
    [
        {
            label:'罗婉宁',
            value:'1010'
        },
        {
            label:'罗小宁',
            value:'1011'
        },
        {
            label:'罗大宁',
            value:'2020'
        },
        {
            label:'罗公子',
            value:'5201'
        },
    ]
)
const price=ref('5201')
</script>


<style scoped>

</style>